export default function getAreaChart(optionSet = []) {
  optionSet = [
    {
      value: 335,
      name: '直达'
    },
    {
      value: 310,
      name: '邮件营销'
    },
    {
      value: 234,
      name: '联盟广告'
    },
    {
      value: 135,
      name: '视频广告'
    },
    {
      value: 1048,
      name: '百度'
    },
    {
      value: 251,
      name: '谷歌'
    },
    {
      value: 147,
      name: '必应'
    },
    {
      value: 102,
      name: '其他'
    }
  ];

  const option = {
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: optionSet.map(item => item.name)
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: optionSet.map(item => item.value),
        type: 'line',
        areaStyle: {}
      }
    ]
  };

  return option;
}
